package au.edu.unsw.editingtool.db;

import java.sql.SQLException;
import java.util.Hashtable;

import au.edu.unsw.editingtool.global.EditingToolException;

public class DBPublication extends DBManager {
	
	protected void setupDBMapping() {
		if (MappingTable.size() > 0)
			return;
		MappingTable.put("Publication", "pid");
		MappingTable.put("Owner", "owner");
	}
	
	public DBPublication() {
		this.table = "publication";
		this.primaryKeys = new String[]{"Publication"};
		this.setupDBMapping();
	}
	
	public void addPublication(Hashtable<String, String> publication) throws EditingToolException, SQLException, ClassNotFoundException {
		this.setTable(this.table, "");
		this.setColumnValues(publication);
		
		this.initDB();

		this.insert(false, false);
		this.clean();
	}
	
	
	
}
